//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.spring.schedule_system.dengxiaojiao.util;

import cn.hutool.core.util.URLUtil;
import com.szlanyou.youcloud.core.util.LyBeanUtils;
import com.szlanyou.youcloud.core.util.LyObjectUtil;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.compress.utils.Lists;

public class BusinessContext implements Serializable {
    private static final long serialVersionUID = 1L;
    private static final ThreadLocal<BusinessContext> businessContext = new ThreadLocal<BusinessContext>() {
        protected BusinessContext initialValue() {
            return new BusinessContext();
        }
    };
    protected final Map<String, Object> attachments;
    protected final List<Object> attachArray;
    private String belongFactoryId;
    private String brandCode;
    private String companyId;
    private String dlrId;
    private String dlrCode;
    private String dlrShortName;
    private String empId;
    private String empName;
    private String groupId;
    private String oemId;
    private String orgId;
    private String orgName;
    private String orgType;
    private String userId;
    private String userName;
    private String dlrOrgType;
    private String parentDlrId;
    private String version;
    private String source;
    private String posId;
    private String posCode;
    private String stationId;
    private String stationName;
    private String saleBrandCode;
    private String serviceBrandCode;
    private String brandCn;
    private String mainBrandCode;
    private String mainBrandName;
    private String orgCarBrandCode;
    private String orgCarBrandCn;
    private String saleBrandName;
    private String mainOrgCarBrandCode;
    private String mainOrgCarBrandCn;
    private String carBrandCode;
    private String carBrandCn;

    private BusinessContext() {
        this.attachments = new HashMap();
        this.attachArray = Lists.newArrayList();
    }

    public static BusinessContext getBusinessContext() {
        return (BusinessContext)businessContext.get();
    }

    public static void copyCommon(Object t) {
        CommonContext commonContext = new CommonContext();
        BusinessContext businessContext = getBusinessContext();
        commonContext.setCreator(businessContext.getUserId()).setCreatorName(businessContext.getEmpName()).setGroupId(businessContext.getGroupId()).setModifier(businessContext.getUserId()).setModifierName(businessContext.getEmpName()).setOemId(businessContext.getOemId());
        LyBeanUtils.copyProperties(commonContext, t);
    }

    public static Map<String, String> getCopyOfBusinessContext() {
        BusinessContext businessContext = getBusinessContext();
        return LyObjectUtil.convertToMapStr(businessContext);
    }

    public String getCarBrandCode() {
        return this.carBrandCode;
    }

    public BusinessContext setCarBrandCode(String carBrandCode) {
        this.carBrandCode = carBrandCode;
        return this;
    }

    public String getCarBrandCn() {
        return this.carBrandCn;
    }

    public BusinessContext setCarBrandCn(String carBrandCn) {
        this.carBrandCn = carBrandCn;
        return this;
    }

    public String getMainOrgCarBrandCode() {
        return this.mainOrgCarBrandCode;
    }

    public BusinessContext setMainOrgCarBrandCode(String mainOrgCarBrandCode) {
        this.mainOrgCarBrandCode = mainOrgCarBrandCode;
        return this;
    }

    public String getMainOrgCarBrandCn() {
        return this.mainOrgCarBrandCn;
    }

    public BusinessContext setMainOrgCarBrandCn(String mainOrgCarBrandCn) {
        this.mainOrgCarBrandCn = mainOrgCarBrandCn;
        return this;
    }

    public String getSaleBrandName() {
        return this.saleBrandName;
    }

    public BusinessContext setSaleBrandName(String saleBrandName) {
        this.saleBrandName = saleBrandName;
        return this;
    }

    public String getMainBrandCode() {
        return this.mainBrandCode;
    }

    public BusinessContext setMainBrandCode(String mainBrandCode) {
        this.mainBrandCode = mainBrandCode;
        return this;
    }

    public String getMainBrandName() {
        return this.mainBrandName;
    }

    public BusinessContext setMainBrandName(String mainBrandName) {
        this.mainBrandName = mainBrandName;
        return this;
    }

    public String getOrgCarBrandCode() {
        return this.orgCarBrandCode;
    }

    public BusinessContext setOrgCarBrandCode(String orgCarBrandCode) {
        this.orgCarBrandCode = orgCarBrandCode;
        return this;
    }

    public String getOrgCarBrandCn() {
        return this.orgCarBrandCn;
    }

    public BusinessContext setOrgCarBrandCn(String orgCarBrandCn) {
        this.orgCarBrandCn = orgCarBrandCn;
        return this;
    }

    public String getBrandCn() {
        return this.brandCn;
    }

    public BusinessContext setBrandCn(String brandCn) {
        this.brandCn = brandCn;
        return this;
    }

    public String getSaleBrandCode() {
        return this.saleBrandCode;
    }

    public BusinessContext setSaleBrandCode(String saleBrandCode) {
        this.saleBrandCode = saleBrandCode;
        return this;
    }

    public String getServiceBrandCode() {
        return this.serviceBrandCode;
    }

    public BusinessContext setServiceBrandCode(String serviceBrandCode) {
        this.serviceBrandCode = serviceBrandCode;
        return this;
    }

    public String getStationName() {
        return this.stationName;
    }

    public BusinessContext setStationName(String stationName) {
        this.stationName = stationName;
        return this;
    }

    public String getStationId() {
        return this.stationId;
    }

    public BusinessContext setStationId(String stationId) {
        this.stationId = stationId;
        return this;
    }

    public String getPosId() {
        return this.posId;
    }

    public BusinessContext setPosId(String posId) {
        this.posId = posId;
        return this;
    }

    public String getPosCode() {
        return this.posCode;
    }

    public BusinessContext setPosCode(String posCode) {
        this.posCode = posCode;
        return this;
    }

    public String getVersion() {
        return this.version;
    }

    public BusinessContext setVersion(String version) {
        this.version = version;
        return this;
    }

    public String getSource() {
        return this.source;
    }

    public BusinessContext setSource(String source) {
        this.source = source;
        return this;
    }

    public String getBelongFactoryId() {
        return this.belongFactoryId;
    }

    public BusinessContext setBelongFactoryId(String belongFactoryId) {
        this.belongFactoryId = belongFactoryId;
        return this;
    }

    public String getBrandCode() {
        return this.brandCode;
    }

    public BusinessContext setBrandCode(String brandCode) {
        this.brandCode = brandCode;
        return this;
    }

    public String getCompanyId() {
        return this.companyId;
    }

    public BusinessContext setCompanyId(String companyId) {
        this.companyId = companyId;
        return this;
    }

    public String getDlrId() {
        return this.dlrId;
    }

    public BusinessContext setDlrId(String dlrId) {
        this.dlrId = dlrId;
        return this;
    }

    public String getDlrCode() {
        return this.dlrCode;
    }

    public BusinessContext setDlrCode(String dlrCode) {
        this.dlrCode = dlrCode;
        return this;
    }

    public String getDlrShortName() {
        return this.dlrShortName;
    }

    public BusinessContext setDlrShortName(String dlrShortName) {
        this.dlrShortName = dlrShortName;
        return this;
    }

    public String getEmpId() {
        return this.empId;
    }

    public BusinessContext setEmpId(String empId) {
        this.empId = empId;
        return this;
    }

    public String getEmpName() {
        return this.empName;
    }

    public BusinessContext setEmpName(String empName) {
        this.empName = empName;
        return this;
    }

    public String getGroupId() {
        return this.groupId;
    }

    public BusinessContext setGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

    public String getOemId() {
        return this.oemId;
    }

    public BusinessContext setOemId(String oemId) {
        this.oemId = oemId;
        return this;
    }

    public String getOrgId() {
        return this.orgId;
    }

    public BusinessContext setOrgId(String orgId) {
        this.orgId = orgId;
        return this;
    }

    public String getOrgName() {
        return this.orgName;
    }

    public BusinessContext setOrgName(String orgName) {
        this.orgName = orgName;
        return this;
    }

    public String getOrgType() {
        return this.orgType;
    }

    public BusinessContext setOrgType(String orgType) {
        this.orgType = orgType;
        return this;
    }

    public String getUserId() {
        return this.userId;
    }

    public BusinessContext setUserId(String userId) {
        this.userId = userId;
        return this;
    }

    public String getUserName() {
        return this.userName;
    }

    public BusinessContext setUserName(String userName) {
        this.userName = userName;
        return this;
    }

    public String getDlrOrgType() {
        return this.dlrOrgType;
    }

    public BusinessContext setDlrOrgType(String dlrOrgType) {
        this.dlrOrgType = dlrOrgType;
        return this;
    }

    public String getParentDlrId() {
        return this.parentDlrId;
    }

    public BusinessContext setParentDlrId(String parentDlrId) {
        this.parentDlrId = parentDlrId;
        return this;
    }

    public static void setContext(BusinessContext context) {
        businessContext.set(context);
    }

    public BusinessContext setAttachment(String key, String value) {
        return this.setObjectAttachment(key, value);
    }

    public BusinessContext addAttachArray(Object obj) {
        if (null != obj) {
            this.attachArray.add(obj);
        }

        return this;
    }

    public List<Object> getAttachArray() {
        return this.attachArray;
    }

    public BusinessContext setAttachment(String key, Object value) {
        return this.setObjectAttachment(key, value);
    }

    public BusinessContext setObjectAttachment(String key, Object value) {
        if (value == null) {
            this.attachments.remove(key);
        } else {
            this.attachments.put(key, value);
        }

        return this;
    }

    public Object getAttachment(String key) {
        return this.attachments.get(key);
    }

    public Map<String, Object> getAttachments() {
        return this.attachments;
    }

    public static void setContext(Map<String, String> copyContext) {
        getBusinessContext().setBelongFactoryId((String)copyContext.get("belongFactoryId")).setBrandCode((String)copyContext.get("brandCode")).setCompanyId((String)copyContext.get("companyId")).setDlrId((String)copyContext.get("dlrId")).setDlrCode((String)copyContext.get("dlrCode")).setDlrShortName(URLUtil.decode((String)copyContext.get("dlrShortName"))).setEmpId((String)copyContext.get("empId")).setEmpName(URLUtil.decode((String)copyContext.get("empName"))).setGroupId((String)copyContext.get("groupId")).setOemId((String)copyContext.get("oemId")).setOrgId((String)copyContext.get("orgId")).setOrgName(URLUtil.decode((String)copyContext.get("orgName"))).setOrgType((String)copyContext.get("orgType")).setUserId((String)copyContext.get("userId")).setUserName(URLUtil.decode((String)copyContext.get("userName"))).setDlrOrgType((String)copyContext.get("dlrOrgType")).setParentDlrId((String)copyContext.get("parentDlrId")).setPosId((String)copyContext.get("posId")).setStationId((String)copyContext.get("stationId")).setStationName(URLUtil.decode((String)copyContext.get("stationName"))).setSaleBrandCode((String)copyContext.get("saleBrandCode")).setServiceBrandCode((String)copyContext.get("serviceBrandCode")).setBrandCn(URLUtil.decode((String)copyContext.get("brandCn"))).setVersion((String)copyContext.get("version")).setSource((String)copyContext.get("source")).setCarBrandCode((String)copyContext.get("carBrandCode")).setCarBrandCn((String)copyContext.get("carBrandCn")).setMainBrandCode((String)copyContext.get("mainBrandCode")).setMainBrandName((String)copyContext.get("mainBrandName")).setOrgCarBrandCode((String)copyContext.get("orgCarBrandCode")).setSaleBrandName((String)copyContext.get("saleBrandName")).setOrgCarBrandCn((String)copyContext.get("orgCarBrandCn")).setMainOrgCarBrandCn((String)copyContext.get("mainOrgCarBrandCn")).setMainOrgCarBrandCode((String)copyContext.get("mainOrgCarBrandCode")).setPosCode((String)copyContext.get("posCode"));
    }

    public static void setInit() {
        getBusinessContext().setBelongFactoryId("1").setBrandCode("1").setCompanyId("1").setDlrId("1").setDlrCode("1").setDlrShortName("1").setEmpId("1").setEmpName("1").setGroupId("1").setOemId("1").setOrgId("1").setOrgName("1").setOrgType("1").setUserId("1").setUserName("1").setDlrOrgType("1").setParentDlrId("1").setPosId("1").setStationId("1").setStationName("1").setSaleBrandCode("1").setServiceBrandCode("1").setBrandCn("1").setVersion("1").setSource("1").setCarBrandCode("1").setCarBrandCn("1").setMainBrandCode("1").setMainBrandName("1").setOrgCarBrandCode("1").setSaleBrandName("1").setOrgCarBrandCn("1").setMainOrgCarBrandCn("1").setMainOrgCarBrandCode("1").setPosCode("1");
    }

    public static void destroy() {
        businessContext.remove();
    }
}
